package com.ruicar.afs.cloud.apply.admin.manage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.apply.admin.manage.entity.SysPermission;

import java.util.List;

/**
 * @author: Lee
 * @date: 2020/06/05
 * @description:
 */
public interface ApplyPermissionService extends IService<SysPermission> {
    /**
     * 通过层级查找
     * 默认升序
     *
     * @param level
     * @return
     */
    List<SysPermission> findByLevelOrderBySortOrder(Integer level);

    /**
     * 通过parendId查找
     *
     * @param parentId
     * @return
     */
    List<SysPermission> findByParentIdOrderBySortOrder(String parentId);

    /**
     * 通过类型和状态获取
     *
     * @param type
     * @param status
     * @return
     */
    List<SysPermission> findByTypeAndStatusOrderBySortOrder(Integer type, String status);

    /**
     * 通过名称获取
     *
     * @param title
     * @return
     */
    List<SysPermission> findByTitle(String title);

    /**
     * 模糊搜索
     *
     * @param title
     * @return
     */
    List<SysPermission> findByTitleLikeOrderBySortOrder(String title);

    /**
     * Find by user id list.
     *
     * @param userId the user id
     * @return the list
     */
    List<SysPermission> findByUserId(Long userId);
}
